package com.walter.db.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author wuchenxi
 * @since 2020-08-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiParam(hidden = true)
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 昵称
     */
    @ApiParam(name = "nickname", value = "昵称")
    private String nickname;

    /**
     * 微信openid
     */
    @ApiParam(hidden = true)
    private String openid;

    /**
     * 账号
     */
    @NotEmpty(message = "账号不能为空！")
    @ApiParam(name = "account", required = true, value = "账号，账号长度不得超过20位！")
    private String account;

    /**
     * 密码
     */
    @NotEmpty(message = "密码不能为空！")
    @ApiParam(name = "password", required = true, value = "密码")
    private String password;

    /**
     * 盐值
      */
    private String salt;

    /**
     * 账号生成时间
     */
    @ApiParam(hidden = true)
    private Date createTime;

    /**
     * 邮箱
     */
    @ApiParam(name = "mail", required = true, value = "邮箱")
    @Email
    @NotEmpty(message = "请输入邮箱！")
    @NotNull(message = "请输入邮箱！")
    private String mail;

}
